\documentclass[twoside,a4paper]{article}
\usepackage{geometry}
\geometry{margin=1.5cm, vmargin={0pt,1cm}}
\setlength{\topmargin}{-1cm}
\setlength{\paperheight}{29.7cm}
\setlength{\textheight}{25.3cm}

% useful packages.
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{layout}

% some common command
\newcommand{\dif}{\mathrm{d}}
\newcommand{\avg}[1]{\left\langle #1 \right\rangle}
\newcommand{\difFrac}[2]{\frac{\dif #1}{\dif #2}}
\newcommand{\pdfFrac}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\OFL}{\mathrm{OFL}}
\newcommand{\UFL}{\mathrm{UFL}}
\newcommand{\fl}{\mathrm{fl}}
\newcommand{\op}{\odot}
\newcommand{\Eabs}{E_{\mathrm{abs}}}
\newcommand{\Erel}{E_{\mathrm{rel}}}

\begin{document}

\pagestyle{fancy}
\fancyhead{}
\lhead{NAME Jiatu Yan}
\chead{Numerical ODE/PDE homework \#6}
\rhead{Date 2021.6.22}


\section*{I. Exercise 12.5 Repeat the procedures in the above proff to generate the fifth-order interpolation matrix.}

Like the proof in Theorem 12.4, we take Taylor expansion of $\varphi_{i_1+2}$, $\varphi_{i_1}$, $\varphi_{i_1+3}$,
$\varphi_{i_1 - 1}$ and $\varphi_{i_1+4}$ in the variable $x_1$ at $\overline{x}:=x_{O,1}+\left(i_1+1  \right)h $ yield
\begin{equation*}
	\begin{split}
		&\left[
			\begin{array}{c c c c c}
				1&1&1&1&1\\
				-1&1&-1&1&-1\\
				2&4&8&16&64\\
				-2&4&-8&16&-64\\
				3&9&27&81&243\\
			\end{array}
		\right]
		\left[
			\begin{array}{c c c c c}
				1&&&&\\
				 &\frac{1}{2}&&&\\
				 &&\frac{1}{6}&&\\
				 &&&\frac{1}{24}&\\
				 &&&&\frac{1}{120}\\
			\end{array}
		\right]
		\left[
			\begin{array}{c}
				h\frac{\partial\Phi^{1}}{\partial x_1}\\
				h^2 \frac{\partial^2\Phi^{1}}{\partial x_2^2}\\
				h^{3} \frac{\partial^{3} \Phi^{1}}{\partial x_1^{3}}\\
				h^{4} \frac{\partial^{4}\Phi^{1}}{\partial x_1^{4}}\\
				h^{5} \frac{\partial^{5}\Phi^{1}}{\partial x_1^{5}}\\
			\end{array}
		\right]_{x_1=\overline{x}}\\
		&=
		\left[
			\begin{array}{c}
				\varphi_{i_1+2}-\varphi_{i_1+1}\\
				\varphi_{i}-\varphi_{i_1+1}\\
				\varphi_{i_1+3}-\varphi_{i_1+1}\\
				\varphi_{i_1-1}-\varphi_{i_1+1}\\
				\varphi_{i_1+4}-\varphi_{i_1+1}\\
			\end{array}
		\right]+\mathrm{O}\left( h^{6} \right) \\
		&=\left[
			\begin{array}{c}
				\delta_i+e^{1}\\
				-\delta_i\\
				\delta_{i+2e^{1}}+\delta_{i+e^{1}}\\
				-\delta_i-\delta_{i-e^{1}}\\
				\delta_{i+3e^{1}}+\delta_{i+2e^{1}}+\delta_{i+e^{1}}\\
			\end{array}
		\right]
		+\mathrm{O}\left( h^{6} \right) \\
		&=
		\left[
			\begin{array}{c c c c c}
				1&&&&\\
				 &-1&&&\\
				1&&1&&\\
				 &-1&&-1&\\
				1&&1&&1\\
			\end{array}
		\right]
		\left[
			\begin{array}{c}
				\delta_{i+e^{1}}\\
				\delta_{i}\\
				\delta_{i+2e^{1}}\\
				\delta_{i-e^{1}}\\
				\delta_{i+3e^{1}}\\
			\end{array}
		\right]
		+\mathrm{O}\left( h^{6} \right) .
	\end{split}
\end{equation*}
Denote these $5\times5$ matrixes as $C$,  $S$ and  $M$, we have
 \[
CS
\left[
	\begin{array}{c}	
		h\frac{\partial\Phi^{1}}{\partial x_1}\\
		h^2 \frac{\partial^2\Phi^{1}}{\partial x_2^2}\\
		h^{3} \frac{\partial^{3} \Phi^{1}}{\partial x_1^{3}}\\
		h^{4} \frac{\partial^{4}\Phi^{1}}{\partial x_1^{4}}\\
		h^{5} \frac{\partial^{5}\Phi^{1}}{\partial x_1^{5}}\\
	\end{array}
\right]
=
M
\left[
	\begin{array}{c}
		\delta_{i+e^{1}}\\
		\delta_{i}\\
		\delta_{i+2e^{1}}\\
		\delta_{i-e^{1}}\\
		\delta_{i+3e^{1}}\\
	\end{array}
\right]+\mathrm{O}\left( h^{6} \right) 
.\] 
We let $T^{\left( 5 \right) }=\left( CS \right)^{-1}M $ and calculate it precisely by matlab. The result is
\[
	T^{\left( 5 \right)} =
\left[
	\begin{array}{c c c c c}  
		47 /60&9 /20&-13 /60&-1 /20&1 /30\\
		5 /4&-5 /4&-1 /12&1 /12&0\\
		-2&1 /2&3 /2&1 /4&-1 /4\\
		-3&3&1&-1&0\\
		6&-4&-4&1&1\\
	\end{array}
\right]
.\] 
Thus we have
\begin{equation}
	\label{eq1}
	\begin{split}
		\left[
			\begin{array}{c}
				\phi\\
				h \frac{\partial \phi}{\partial x_1}\\
				h^2 \frac{\partial^2 \phi}{\partial x_1^{2}}\\
				h^{3} \frac{\partial^{3} \phi}{\partial x_1^{3}}\\
				h^{4} \frac{\partial^{4} \phi}{\partial x_1^{4}}\\
			\end{array}
		\right]_{x_1=\overline{x}}
		=\frac{1}{h}T^{\left( 5 \right) }
		\left[
			\begin{array}{c}
				\delta_{i+e^{1}}\\
				\delta_{i}\\
				\delta_{i+2e^{1}}\\
				\delta_{i-e^{1}}\\
				\delta_{i+3e^{1}}\\
			\end{array}
		\right]
		+\mathrm{O}\left( h^{5} \right) .
	\end{split}
\end{equation}
The left hand side is got from (12.12).
Integrating the frist and the second rows of Equation \ref{eq1} over $\mathcal{F}_{i+\frac{1}{2}e^{d}}$ 
and combining with
\[
	\frac{1}{h^{D}}\int_{\mathcal{F}_{i+\frac{1}{2}e^{d}}}\delta_{i+je^{1}}= \langle\phi\rangle_{i+je^{1}} 
,\] 
we get the formulas of the fifth order with $d=1$.
And the others can be deduced by repetition of the above arguments on the first dimension to all other dimensions.

We can find that the formulas of the fourth order and the fifth order coincide for $\frac{\partial \phi}{\partial x}$.
The reason is that when we adding up the taylor expansion of $\varphi_{i_1+2}$, $\varphi_{i_1}$ and 
$\varphi_{i_1+3}$, $\varphi_{i_1-1}$ in the variable $x_1$ at $\overline{x}$, the term with the fifth order will be eliminated.
In other word, we impose a line operator matrix on both sides of the first equation in this section, we have
\begin{equation}
	\label{eq2}
	\begin{split}
		\left[
			\begin{array}{c c c c c}
				1&&&&\\
				1&1&&&\\
				 &&1&&\\
				 &&1&1&\\
				 &&&&1\\
			\end{array}
		\right]
		C
		\left[
			\begin{array}{c}
				h\frac{\partial\Phi^{1}}{\partial x_1}\\
				\frac{h^2}{2} \frac{\partial^2\Phi^{1}}{\partial x_2^2}\\
				\frac{h^{3}}{6} \frac{\partial^{3} \Phi^{1}}{\partial x_1^{3}}\\
				\frac{h^{4}}{24} \frac{\partial^{4}\Phi^{1}}{\partial x_1^{4}}\\
				\frac{h^{5}}{120} \frac{\partial^{5}\Phi^{1}}{\partial x_1^{5}}\\
			\end{array}
		\right]&=
		\left[
			\begin{array}{c c c c c}
				1&&&&\\
				1&-1&&\\
				1&&1&&\\
				1&-1&1&-1&\\
				1&&1&&1\\
			\end{array}
		\right]
		\left[
			\begin{array}{c}
				\delta_{i+e^{1}}\\
				\delta_{i}\\
				\delta_{i+2e^{1}}\\
				\delta_{i-e^{1}}\\
				\delta_{i+3e^{1}}\\
			\end{array}
		\right]\\
	\end{split}
\end{equation}
Due to 
\[
\left[
	\begin{array}{c c c c c}
		1&&&&\\
		1&1&&&\\
		&&1&&\\
		&&1&1&\\
		&&&&1\\
	\end{array}
\right]
C
=
\left[
	\begin{array}{c c c c c}
		1&1&1&1&1\\
		0&2&0&2&0\\
		2&4&8&16&64\\
		0&8&0&32&0\\
		3&9&27&81&243\\
	\end{array}
\right]
,\] 
we can easily seperating out the second and forth line of the equations and get
\begin{equation}
	\label{eq3}
\left[
	\begin{array}{c c}
		2&2\\
		8&16\\
	\end{array}
\right]
\left[
	\begin{array}{c}
		\frac{h^2}{2} \frac{\partial^2\Phi^{1}}{\partial x_2^2}\\
		\frac{h^{4}}{24} \frac{\partial^{4}\Phi^{1}}{\partial x_1^{4}}\\
	\end{array}
\right]
=
\left[
	\begin{array}{c}
		\delta_{i+e^{1}}-\delta_{i}\\
		\delta_{i+e^{1}}-\delta_{i}+\delta_{i+2e^{1}}-\delta_{i-e^{1}}\\
	\end{array}
\right]
.
\end{equation}
Thus we can deduce the formula for $\frac{\partial \phi}{\partial x}$ from the equation above.
Since the first to the forth line of the equations in Equation \ref{eq2} are the same of those in the case for the forth order,
the Equation \ref{eq3} is totally the same as that in the case for the forth order,
which explains why the formulas of the fourth order and the fifth order coincide for $\frac{\partial \phi}{\partial x}$. 

\section*{II. Exercise 12.10 When no boundary conditions are known, a scalar $\psi$ can be smoothly extended to fill a ghost cell abouting the boundary. Derive the formulas}

For each $x$ in cell  $\mathcal{C}_{i+e^{d}}$, we can derive the taylor expansions of $\psi\left( x-ie^{d} \right)  $
, where $i=1,2,3,4,5$ on  $x$, which are
\begin{equation*}
	\begin{split}
		\left[
			\begin{array}{c}
				\psi\left( x-e^{d} \right)\\ 
				\psi\left( x-2e^{d} \right)\\ 
				\psi\left( x-3e^{d} \right)\\ 
				\psi\left( x-4e^{d} \right)\\ 
				\psi\left( x-5e^{d} \right)\\ 
			\end{array}
		\right]
		=
		\left[
			\begin{array}{c c c c c}
				1&-1&1&-1&1\\
				1&-2&4&-8&16\\
				1&-3&9&-27&81\\
				1&-4&16&-64&256\\
				1&-5&25&-125&625\\
			\end{array}
		\right]
		\left[
			\begin{array}{c c c c c}
				1&&&&\\
				 &\frac{1}{2}&&&\\
				 &&\frac{1}{6}&&\\
				 &&&\frac{1}{24}&\\
				 &&&&\frac{1}{120}\\
			\end{array}
		\right]
		\left[
			\begin{array}{c}
				\psi\left( x \right) \\
				h \frac{\partial \psi\left( x \right) }{\partial x_d}\\
				h^2 \frac{\partial^2 \psi\left( x \right) }{\partial x_d^2}\\
				h^{3} \frac{\partial^{3} \psi\left( x \right) }{\partial x_d^{3}}\\
				h^{4} \frac{\partial^{4} \psi\left( x \right) }{\partial x_d^{4}}\\
			\end{array}
		\right]
		+\mathrm{O}\left( h^{5} \right). 
	\end{split}
\end{equation*}
We denote the two matrixes as $C$ and $S$, from left to right respectively.
We want to determin the coefficients $a_{i}$'s, where $i=1,2,3,4,5$, of them that satisfiy
\[
	\sum_{i=1}^{5}a_i\psi\left( x-ie^{d} \right)=\psi\left( x \right)+\mathrm{O}\left( h^{5} \right)   
.\] 
Thus we can deduce linear equations about the coefficients $a_i$'s
\begin{equation}
	\begin{split}
	\left( CS \right)^{T} 
	\left[
		\begin{array}{c}
			a_1\\
			a_2\\
			a_3\\
			a_4\\
			a_5\\
		\end{array}
	\right]
	=
	\left[
		\begin{array}{c c c c c}
			1&1&1&1&1\\
			-1 /2&-1&-3 /2&-2&-5 /2\\
			1 /6&2 /3&3 /2&8 /3&25 /6\\
			-1 /24&-1 /3&-9 /8&-8 /3&125 /24\\
			1 /120&2 /15&27 /40&32 /15&125 /24\\
		\end{array}
	\right]
	\left[
		\begin{array}{c}
			a_1\\
			a_2\\
			a_3\\
			a_4\\
			a_5\\
		\end{array}
	\right]
	=
	\left[
		\begin{array}{c}
			1\\
			0\\
			0\\
			0\\
			0\\
		\end{array}
	\right]
\end{split}
\end{equation}
Solving the equations above yields
\[
\left[
	\begin{array}{c}
	 	a_1\\
		a_2\\
		a_3\\
		a_4\\
		a_5\\ 
	\end{array}
	\right]
 =\left[
	 \begin{array}{c}
		 5\\
		 -10\\
		 10\\
		 -5\\
		 1\\
	 \end{array}
 \right].
\] 
Thus we have
\[
	\psi\left(  x\right)=5\psi\left( x-e^{d} \right)-10\psi\left( x-2e^{d} \right)
	+10\psi\left( x-3e^{d} \right)-5\psi\left( x-4e^{d} \right)+\psi\left( x-5e^{d} \right)+\mathrm{O}\left( h^{5} \right)   
.\] 
Then we can get the formula (12.31) by taking cell averages on both sides of the equation.

For the formula (12.32), we can derive it by combining the fifth-order formula deduced in Exercise 12.5 and (12.31).
\begin{equation*}
	\begin{split}
		\langle\psi\rangle_{i+\frac{1}{2}e^{d}}
		=
		&\frac{47}{60}\langle\psi\rangle_{i+e^{d}}+\frac{9}{20}\langle\psi\rangle_{i}-
		\frac{13}{60}\langle\psi\rangle_{i+2e^{d}}-\frac{1}{20}\langle\psi\rangle_{i-e^{d}}
			+\frac{1}{30}\langle\psi\rangle_{i+3e^{d}}+\mathrm{O}\left( h^{5} \right)\\
		=
		&\frac{1}{20}\langle\psi\rangle_{i-e^{d}}+\frac{9}{20}\langle\psi\rangle_{i}
		+\frac{47}{60}\langle\psi\rangle_{i+e^{d}}-\frac{13}{60}\langle\psi\rangle_{i+2e^{d}}\\
		&+\frac{1}{6}
		\langle\psi\rangle_{i+2e^{d}}-\frac{1}{3}\langle\psi\rangle_{i+e^{d}}
		+\frac{1}{3}\langle\psi\rangle_{i}-\frac{1}{6}\langle\psi\rangle_{i-e^{d}}
		+\frac{1}{30}\langle\psi\rangle_{i-2e^{d}}+\mathrm{O}\left( h^{5} \right)\\
		=
		&
		\frac{1}{30}\langle\psi\rangle_{i-2e^{d}}
		-\frac{13}{60}\langle\psi\rangle_{i-e^{d}}+\frac{47}{60}\langle\psi\rangle_{i}
		+\frac{9}{20}\langle\psi\rangle_{i+e^{d}}\\
		&-\frac{1}{4}\langle\psi\rangle_{i+e^{d}}+\frac{1}{2}\langle\psi\rangle_{i}
		-\frac{1}{2}\langle\psi\rangle_{i-e^{d}}+\frac{1}{4}\langle\psi\rangle_{i-2e^{d}}
		-\frac{1}{20}\langle\psi\rangle_{i-3e^{d}}+\mathrm{O}\left( h^{5} \right) \\
		=
		&-\frac{1}{20}\langle\psi\rangle_{i-3e^{d}}+\frac{17}{60}\langle\psi\rangle_{i-2e^{d}}
		-\frac{43}{60}\langle\psi\rangle_{i-e^{d}}+\frac{77}{60}\langle\psi\rangle_{i}\\
		&+\langle\psi\rangle_{i}-2\langle\psi\rangle_{i-e^{d}}+2\langle\psi\rangle_{i-2e^{d}}
		-\langle\psi\rangle_{i-3e^{d}}+\frac{1}{5}\langle\psi\rangle_{i-4e^{d}}+\mathrm{O}\left( h^{5} \right) \\
		=
		&\frac{1}{60}\left( 137\langle\psi\rangle_{i}-163\langle\psi\rangle_{i-e^{d}}
	+137\langle\psi\rangle_{i-2e^{d}}-63\langle\psi\rangle_{i-3e^{d}}+12\langle\psi\rangle_{i-4e^{d}}\right)
		+\mathrm{O}\left( h^{5} \right). 
	\end{split}
\end{equation*}
Thus we have derived formula (12.32).

\section*{III. Exercise 12.20 Prove Lemma 12.19}
From the given condition that $u$ is constant and $\langle f\rangle=0$, we have
\begin{equation*}
	\begin{split}
		\frac{\mathrm{d}\langle\phi\rangle_{i}}{\mathrm{d} t}
		=
		&-\frac{1}{h}\sum_{d=1}^{D}u_{d}\left( 
		\langle\phi\rangle_{i+\frac{1}{2}e^{d}}-
		\langle\phi\rangle_{i-\frac{1}{2}e^{d}}\right) 
		+\frac{\nu}{h}\sum_{d=1}^{D}\left( 
		\langle \frac{\partial \phi}{\partial x_d}\rangle_{i+\frac{1}{2}e^{d}}-
		\langle \frac{\partial \phi}{\partial x_d}\rangle_{i-\frac{1}{2}e^{d}}
		\right) \\
		=
		&-\frac{1}{h}\sum_{d=1}^{D}u_d\left( \frac{1}{12}\langle\phi\rangle_{i-2e^{d}}
		-\frac{2}{3}\langle\phi\rangle_{i-e^{d}}+\frac{2}{3}\langle\phi\rangle_{i+e^{d}}
	-\frac{1}{12}\langle\phi\rangle_{i+2e^{d}}+\mathrm{O}\left( h^{4} \right) 
		\right)\\
		&+\frac{\nu}{h}\sum_{d=1}^{D}\left( -\frac{1}{12}\langle\phi\rangle_{i-2e^{d}}
			+\frac{4}{3}\langle\phi\rangle_{i-e^{d}}-\frac{5}{2}\langle\phi\rangle_{i}
			+\frac{4}{3}\langle\phi\rangle_{i+e^{d}}-\frac{1}{12}\langle\phi\rangle_{i+2e^{d}}+\mathrm{O}\left( h^{4} \right) 
		\right). \\
	\end{split}
\end{equation*}
Replace $\langle\phi\rangle_{i}$ with Fourier mode $y\left( t \right)e^{i\xi x_i} $ and omit the higher order items, we have
\begin{equation*}
	\begin{split}
		e^{i\xi \mathrm{x}_i}\frac{\mathrm{d}y\left( t \right) }{\mathrm{d}t}
		=
		&-\frac{1}{h}\sum_{d=1}^{D}u_d\left( \frac{1}{12}e^{-2i\xi_d h_d}-\frac{2}{3}e^{-i\xi_d h_d}
		+\frac{2}{3}e^{i\xi_d h_d}-\frac{1}{12}e^{2i\xi_d h_d}\right)y\left( t \right) e^{i\xi_d \mathrm{x}_{i}} \\
		&+\frac{\nu}{h^2}\sum_{d=1}^{D}\left( -\frac{1}{12}e^{-2i\xi_d h_d}+\frac{4}{3}e^{-i\xi_d h_d}-\frac{5}{2}
		+\frac{4}{3}e^{i\xi_d h_d}-\frac{1}{12}e^{2i\xi_d h_d}\right)y\left( t \right) e^{i\xi \mathrm{x}_i}\\
		=
		&-\frac{1}{h}\sum_{d=1}^{D}iu_d\left( \frac{4}{3}\sin\left(\theta_d  \right)-\frac{1}{6}\sin\left( 2\theta_d \right)   \right)y\left( t \right)e^{i\xi \mathrm{x}_i}
		+\frac{\nu}{h^2}\sum_{d=1}^{D}\left( -\frac{5}{2}+\frac{8}{3}\cos\left(\theta_d  \right)
		-\frac{1}{6}\cos\left( 2\theta_d \right) \right)y\left( t \right)e^{i\xi \mathrm{x}_i}\\
		=
		&-\frac{1}{h}\sum_{d=1}^{D}iu_{d}\sin\left( \theta_d \right)\left(\frac{4}{3}-\frac{1}{3}\cos\left( \theta_d \right)   \right)y\left( t \right)e^{i\xi\mathrm{x}_i}
		+\frac{\nu}{h^2}\sum_{d=1}^{D}\left( -\frac{5}{2}
		+\frac{8}{3}-\frac{16}{3}\sin^2\left( \frac{\theta_d}{2} \right)-\frac{1}{6}
	+\frac{1}{3}\sin^2\left( \theta_d \right)  \right)y\left( t \right)e^{i\xi\mathrm{x}_i}\\
		=
		&4\frac{\nu}{h^2}\sum_{d=1}^{D}\sin^2\left( \frac{\theta_d}{2} \right)\left\{ -\frac{4}{3}+
		\frac{1}{3}\left[ 1-\sin^2\left(\frac{\theta_d}{2} \right)  \right]  \right\}y\left( t \right)e^{i\xi\mathrm{x}_i}
		-i\frac{1}{h}\sum_{d=1}^{D}u_d\sin\left( \theta_d \right)\left[ 1+\frac{2}{3}\sin^2\left( \frac{\theta_d}{2} \right)  \right]y\left( t \right)e^{i\xi\mathrm{x}_i}\\   
		=
		&-4 \frac{\nu}{h^2}\sum_{d=1}^{D}\sin^2\left( \frac{\theta_d}{2} \right)
		\left( 1+\frac{1}{3}\sin^2\left( \frac{\theta_d}{2} \right)  \right)y\left( t \right)e^{i\xi\mathrm{x}_i}
		-i \frac{1}{h}\sum_{d=1}^{D}u_d\sin(\theta_d)\left( 1+\frac{2}{3}\sin\left( \frac{\theta_d}{2} \right)  \right)y\left( t \right)e^{i\xi\mathrm{x}_i},  \\
	\end{split}
\end{equation*}
where the first line is achieved by formula (12.7) and (12.8), the second line is achieved by Euler's formula and the others are achieved by the formulas about sine and cosine functions.
Thus we can deduced that 
\[
	\frac{\mathrm{d}y}{\mathrm{d}t}=\left( \lambda^{d}+i\lambda^{a} \right)y 
,\]
where
\begin{equation*}
	\begin{split}
		\lambda^{d}&=-4 \frac{\nu}{h^2}\sum_{d=1}^{D}\sin^2 \frac{\theta_d}{2}\left( 1+\frac{1}{3}\sin^2 \frac{\theta_d}{2} \right)\\ 
		\lambda^{a}&=-\frac{1}{h}\sum_{d=1}^{D}u_d\sin \theta_d\left( 1+\frac{2}{3}\sin^2 \frac{\theta_d}{2}\right).\\ 
	\end{split}
\end{equation*}

\section*{IV. Exercise 12.21 Reproduce the following stability region $ \mid \mathcal{R}\left( z \right)<1  \mid $ }
The stability region is shown in Figure \ref{fig1}.
\begin{figure}[ht]
	\centering
	\caption{The figures for the stability region $ \mid  \mathcal{R}\left( z \right) \mid<1 $.}
	\label{fig1}
	\begin{minipage}[t]{0.45\linewidth}
                \centering
		\includegraphics[width=8cm, height = 8cm]{Exercise_12_21_1.eps}
		\end{minipage}
	\begin{minipage}[t]{0.45\linewidth}
                \centering
		\includegraphics[width=8cm, height=8cm]{Exercise_12_21_2.eps}
	\end{minipage}
\end{figure}

We assume $\mu\ge 0$, which means $\sin \theta_d\le 0$
Since the $\lambda^{a}$ is about the diffusion, we have
\begin{equation*}
	\begin{split}
	\overline{\lambda}^{a}=k\lambda^{a}
	&=-\frac{k}{h}\sum_{d=1}^{D}u_d\sin\theta_d\left( 1+\frac{2}{3}\sin^2 \frac{\theta_d}{2} \right)\\
	&\le  -\frac{k \mid u_{d,\max} \mid }{h}D\max_d\left[\sin\theta_d\left( 1+\frac{2}{3}\sin^2 \frac{\theta_d}{2}\right)\right]\\
	&\le 4.\\ 
\end{split}
\end{equation*}
We assume $\cos \theta_d=x$, whose range is $[-1, 1]$, we have
\begin{equation*}
	\begin{split}
		\sin^2 \theta_d\left( 1+\frac{2}{3}\sin^2 \frac{\theta_d}{2}\right)^2
		&=(1-x^2)\frac{\left( 4-x \right)^2 }{9}\\
		&=\frac{1}{9}\left( 1-x^2 \right)\left( 4-x \right)^2\\
		&=p\left( x \right) \\  
	\end{split}
\end{equation*}
Taking derivative of $p\left( x \right) $, we have
\[
	p'\left( x \right)=\left( 4-x \right)\left( 4x^2-8x-2 \right)=0\Rightarrow x=\frac{2-\sqrt{6} }{2}\in[-1,1]   
.\] 
Thus we have 
 \[
	 \mu<\frac{4}{D\sqrt{p\left( \frac{2-\sqrt{6} }{2} \right) }}<\frac{2.9149}{D}
.\] 

\section*{V. Exercise 13.11 For periodic domains, express DG as a linear combination of cell averages to verify that $\mathrm{DG}\neq \mathrm{L}$.}

From definition 12.6, we have
\begin{equation*}
	\begin{split}
		\mathrm{DG}\langle \phi\rangle_{i}
		=
		&\frac{1}{12h}\sum_{d=1}^{D}( -\mathrm{G}_d\langle\phi\rangle_{i+2e^{d}}
		+8\mathrm{G}_d\langle\phi\rangle_{i+e^{d}}-8\mathrm{G}_d\langle\phi\rangle_{i-e^{d}}
		+\mathrm{G}\langle\phi\rangle_{i-2e^{d}})\\
		=
		&\frac{1}{12h^2}\sum_{d=1}^{D}(\frac{1}{12}\langle\phi\rangle_{i+4e^{d}}-\frac{8}{12}
		\langle\phi\rangle_{i+3e^{d}}+\frac{8}{12}
		\langle\phi\rangle_{i+e^{d}}-\frac{1}{12}
		\langle\phi\rangle_{i}\\
		&-\frac{8}{12}
		\langle\phi\rangle_{i+3e^{d}}+\frac{64}{12}
		\langle\phi\rangle_{i+2e^{d}}-\frac{64}{12}
		\langle\phi\rangle_{i}+\frac{1}{12}
		\langle\phi\rangle_{i-e^{d}}\\
		&+\frac{8}{12}
		\langle\phi\rangle_{i+e^{d}}-\frac{64}{12}
		\langle\phi\rangle_{i}+\frac{64}{12}
		\langle\phi\rangle_{i-2e^{d}}-\frac{8}{12}
		\langle\phi\rangle_{i-3e^{d}}\\
		&-\frac{1}{12}
		\langle\phi\rangle_{i}+\frac{8}{12}
		\langle\phi\rangle_{i-e^{d}}-\frac{8}{12}
		\langle\phi\rangle_{i-3e^{d}}+\frac{1}{12}
		\langle\phi\rangle_{i-4e^{d}}
		)\\
		=
		&\frac{1}{12h^2}\sum_{d=1}^{D}( \frac{1}{12}
		\langle\phi\rangle_{i+4e^{d}}-\frac{4}{3}
		\langle\phi\rangle_{i+3e^{d}}+\frac{16}{3}
		\langle\phi\rangle_{i+2e^{d}}+\frac{4}{3}
		\langle\phi\rangle_{i+e^{d}}\\
		&-\frac{65}{6}
		\langle\phi\rangle_{i}+\frac{3}{4}
		\langle\phi\rangle_{i-e^{d}}+\frac{16}{3}
		\langle\phi\rangle_{i-2e^{d}}-\frac{4}{3}
		\langle\phi\rangle_{i-3e^{d}}+\frac{1}{12}
		\langle\phi\rangle_{i-4e^{d}}
		) \\
	\end{split}
\end{equation*}
Obviously, $\mathrm{DG}\neq L$. 

For the one dimensional stencil, we can view the set $\{\langle\phi\rangle_i\}$ as a vector $\Phi$ with length n, 
where n is the number of the segments. We let
\[
	\Phi_i=\langle\phi\rangle_i, \quad i=1,\ldots,n
.\] 
Thus by periodic domains, we can write out the matrix form of the operator $\mathrm{DG}$ 
\[
	\mathrm{DG}=
	\left[
		\begin{array}{c c c c c c c c c c}
			-65 /6& 3 /4& 16 /3& -4 /3& 1 /12& \ldots&1 /12& -4 /3& 16 /3&4 /3\\
			4 /3&-65 /6&3 /4&16 /3&-4 /3&\ldots&0&1 /12&-4 /3&16 /3\\
			    &&&&&\ddots&&&&\\
			16 /3&-4 /3&1 /12&0&0&\ldots&16 /3&4 /3&-65 /6&3 /4\\
			3 /4& 16 /3&-4 /3&1 /12&0&\ldots&-4 /3&16 /3&4 /3&-65 /6\\
		\end{array}
	\right]
	\left[
		\begin{array}{c}
			\Phi_1\\
			\Phi_2\\
			\vdots\\
			\Phi_{n-1}\\
			\Phi_n\\
		\end{array}
	\right]
.\] 
\section*{VI. Exercise 13.13 Show that the discrete operator $\mathrm{P}_E = \mathrm{I} - \mathrm{G}\left( \mathrm{DG} \right)^{-1}\mathrm{D}$ is indeed a projection.}
It is obvious that 
\begin{equation*}
	\begin{split}
		\mathrm{P}_E^{^2}&=\left( \mathrm{I}-\mathrm{G}\left( \mathrm{DG} \right)^{-1}\mathrm{D}  \right)^2\\
				 &=\mathrm{I}-2\mathrm{G}\left( \mathrm{DG} \right)^{-1}\mathrm{D}
				 +\mathrm{G}\left( \mathrm{DG} \right)^{-1}\mathrm{DG}\left( \mathrm{DG} \right)^{-1}\mathrm{D}\\
				 &=\mathrm{I}-\mathrm{G}\left( \mathrm{DG} \right)^{-1}\mathrm{D}\\
				 &=\mathrm{P}_E.\\
	\end{split}
\end{equation*}
Thus we have $\mathrm{P}_E$ is a projection.
\end{document}

%%% Local Variables: 
%%% mode: latex
%%%%% End: 
